import { NodeView } from '@antv/x6'

export class SimpleNodeView extends NodeView {
  protected

  renderMarkup() {
    return this.renderJSONMarkup({
      tagName: 'rect',
      selector: 'body'
    })
  }

  update() {
    super.update({
      body: {
        refWidth: '100%',
        refHeight: '100%',
        fill: '#31d0c6'
      }
    })
  }
}

const minimap = {
  enabled: true,
  padding: 10,
  graphOptions: {
    async: true,
    getCellView(cell) {
      if (cell.isNode()) {
        return SimpleNodeView
      }
    }
  }
}
export default {
  minimap
}
